package com.honeywen.mymvc.security;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author wangwei
 * @date 2019/1/18 下午6:13
 */
public class FormFilter {

    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {

        String url = request.getRequestURI();
        Cookie[] cookies = request.getCookies();
        for (int i = 0; i < cookies.length; i++) {
            System.out.println(cookies[i]);

        }
        Cookie cookie = new Cookie("name", "bb");
        cookie.setMaxAge(4);
        response.addCookie(new Cookie("jack", "reose"));


        return true;

    }

}
